Task #853/#866: shortcut.hwp 구분 칸 spacing 압축 + 본문영역 초과 정정#868
Closed
planet6897 wants to merge 2 commits into
Closed
Task #853/#866: shortcut.hwp 구분 칸 spacing 압축 + 본문영역 초과 정정#868planet6897 wants to merge 2 commits into
planet6897 wants to merge 2 commits into
Conversation
Contributor
Author
|
갱신: Task #866(쪽나누기 페이지 헤더 TAC 띠↔본문 ~28px gap)을 본 PR 에 squash 통합 (단일 커밋 추가된 정정:
결과: 1쪽 본문 +149.3px(PDF +148 ✓), 2쪽 +89.5px(PDF ~+85), 3쪽 +102.3px(PDF ~+93). LAYOUT_OVERFLOW 25→4. 잔존: #866(2·3쪽 |
… 초과 정정 대상: samples/basic/shortcut.hwp ↔ 한컴 PDF pdf/basic/shortcut-2022.pdf (증상1) 모든 구분 칸(섹션 헤더 띠) 위·아래 줄 간격 압축 (증상2) 일부 페이지 본문영역 초과. closes edwardkim#853 · 잔존은 edwardkim#866(쪽나누기 페이지 ~28px gap 정밀화) / edwardkim#867(페이지 수 7≠8 + overflow) 로 분리. ## 정정 - src/renderer/layout/paragraph_layout.rs::layout_composed_paragraph — is_column_top && para_index==0(섹션 첫 문단)일 때 spacing_before 를 LINE_SEG.vertical_pos 로 상한 클램프해 적용. 제목 baseline 79.4→105.8 (top 약 83.8px ≈ 한컴 PDF 83.6px). - src/renderer/typeset.rs::place_table_with_text — 전폭 글자처럼-취급 표가 자동 줄바꿈으로 자기 LINE_SEG 줄에 놓인 경우, 표 줄 높이와 일치하는 LINE_SEG 인덱스로 표 앞 텍스트 줄(line0)을 표보다 먼저 PartialParagraph 로 emit. PUA 필러 케이스는 is_alphanumeric() 로 제외. - src/renderer/typeset.rs::process_multicolumn_break — (1) 1단 ColumnDef 의 가로 단 간격(1단이라 무의미)을 zone 진입 세로 간격으로 ((이전 zone /2)+(새 zone /2)). (2) 직전 zone 마지막 paragraph 가 wrap=위아래 글자처럼-취급 표 & 1단 ColumnDef 간격=0 이면 vpos_zone_height 에 표 band 높이 추가 (한컴 PDF: 헤더 띠 하단↔본문 약 28~33px ≈ 표 band 높이). (3) 새 다단 zone 시작 여유가 헤더 띠 1개 높이(약 4*line) 미만이면 다음 페이지로. (4) Distribute 다단 vpos-reset 검출을 직전 문단 vpos+line_height 기준으로 → 1줄짜리 컬럼도 컬럼 전환 인식. - src/renderer/layout.rs::build_columns — zone-간 세로 여백(ColumnDef 간격/2 + 표 band)을 layout 의 prev_zone_y_end 누적에도 미러(종전엔 pagination 메타데이터에만 반영되어 SVG 렌더 미적용이었음). ## 결과 (SVG ↔ 한컴 PDF, into body 기준) - 1쪽: 제목 top +26.5px(PDF +26.8 OK), 헤더 띠 zone +88px(PDF +87.6 OK), 본문 +149.3px(PDF +148 OK) - 2쪽: 헤더 띠 +19.8/+43.3px(PDF +19.1/+43.1 OK), 본문 +89.5px(PDF 약 +85, 약 4.5px 초과) - 3쪽: 본문 +102.3px(PDF 약 +93, 약 9px 초과; 종전 약 24px 부족) - LAYOUT_OVERFLOW 25 → 4 (잔존 4건은 edwardkim#867 영역) ## 검증 - cargo test --release 34 test suites 전건 통과. svg_snapshot 8/8 — golden 2건 (issue-267 목차 제목, issue-617 exam_kor p5) 갱신: 섹션-시작 문단이 LINE_SEG.vertical_pos 기준으로 재배치, 한컴 기록값 정합. shortcut.hwp/KTX.hwp/exam_kor.hwp 외 변경 없음. 문서: mydocs/tech/hancom_zone_paragraph_spacing.md, mydocs/report/task_m100_853_report.md, mydocs/report/task_m100_866_report.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PageItem 의 5개 variant가 모두 위 arm에서 처리되므로 `_ => None`은 `unreachable_pattern` 으로 deny 됨. `and_then`을 `map`으로 변경하여 None 케이스 자체를 제거. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
planet6897
added a commit
to planet6897/rhwp
that referenced
this pull request
May 13, 2026
PageItem 의 5개 variant가 모두 위 arm에서 처리되므로 `_ => None`은 `unreachable_pattern` 으로 deny 됨. `and_then`을 `map`으로 변경하여 None 케이스 자체를 제거. PR edwardkim#868 의 같은 fix를 edwardkim#872 superset 에도 적용. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
planet6897
added a commit
to planet6897/rhwp
that referenced
this pull request
May 13, 2026
…기] 경로) + 측정 다단 zone 의 마지막 컬럼에서 [단나누기] 를 만나면 종전엔 무조건 새 페이지로 밀렸음 → shortcut.hwp pi=94 "<편집 화면 분할에서>" 가 페이지 하단 여유가 충분한데도 4쪽으로 밀리는 회귀 (PR edwardkim#868 결합). 수정: 배분(Distribute) 다단의 마지막 컬럼 [단나누기] 만 process_multicolumn_break 로 라우팅 → 현재 ColumnDef 유지한 채 같은 페이지 여유 있으면 이전 밴드 아래에, 부족할 때만 새 페이지로. 신문형(Normal) 다단은 종전 동작(=새 페이지) 유지 → exam_math.hwp / 21_언어_기출 류 페이지 수 영향 없음. 결과: - shortcut.hwp pi=94 가 3쪽 zone_y_offset≈203 에 배치 (한컴 PDF 정합) - shortcut.hwp 페이지 수 8 → 7 (한컴 PDF 7쪽 정합) - cargo test --release 34 suites 1232 통과 - LAYOUT_OVERFLOW 4 → 6 (3쪽이 더 채워진 부작용, Stage 2 의 전환 간격 정정으로 3쪽이 한컴처럼 일찍 끊기면 해소 예상) 문서: - mydocs/plans/task_m100_866_v2_impl.md — 4 stage 구현 계획서 - mydocs/working/task_m100_866_v2_stage1.md — pi=94 수정 상세 + PDF↔SVG 정밀 측정 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
planet6897
added a commit
to planet6897/rhwp
that referenced
this pull request
May 13, 2026
PageItem 의 5개 variant가 모두 위 arm에서 처리되므로 `_ => None`은 `unreachable_pattern` 으로 deny 됨. `and_then`을 `map`으로 변경하여 None 케이스 자체를 제거. PR edwardkim#868 의 같은 fix를 edwardkim#872 superset 에도 적용. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
edwardkim
pushed a commit
that referenced
this pull request
May 14, 2026
…closes #866) PR #872 (@planet6897) GitHub diff 기반 cherry-pick. mydocs 거버넌스 산출물 제외. supersedes PR #868. #866 v2: 구분 칸 spacing 압축 + solo_zone_pad + zone별 점선 구분선 #866 v3: 헤더 띠 leaving 보정 + <...> paragraph spacing #874: 헤더 띠 band 가산 제거 + auto_tab_right 정렬 + 스케일 도형 글꼴 검증: - cargo test --release --lib: 1246 passed (회귀 0) - SVG 7페이지 (한컴 2022 PDF 정합) - 시각 판정 ★ 통과 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
samples/basic/shortcut.hwp↔ 한컴 PDFpdf/basic/shortcut-2022.pdf— (증상1) 모든 구분 칸(섹션 헤더 띠) 위·아래 줄 간격 압축, (증상2) 일부 페이지 본문영역 초과 렌더링. closes #853.정정
paragraph_layout.rs::layout_composed_paragraphis_column_top && para_index==0(섹션 첫 문단)일 때spacing_before를 통째 드롭하지 않고LINE_SEG.vertical_pos로 상한 클램프해 적용. 제목 baseline 79.4→105.8 (top≈83.8px ≈ 한컴 PDF 83.6px). 페이지 break 후 column-top(para_index>0)은 종전대로 0.typeset.rs::place_table_with_textPartialParagraph로 emit. PUA 필러 케이스(복학원서.hwp pi=16)는is_alphanumeric()로 제외. 2쪽 "파일" 헤더 띠 상단 +3.8→+19.8px(PDF +19.1px), 하단 +27.3→+43.3px(PDF +43.1px).typeset.rs간격(가로 단 간격이지만 1단이라 무의미)을 zone 진입 세로 간격으로 — zone 전환 시 (이전 zone 디자인 spacing /2)+(새 zone /2) 를zone_y_offset에 더함(다단 ColumnDef 는 0). 1쪽 헤더 띠 zone 69.1→88.0(PDF +87.6px), 본문 zone 100.2→138.0(PDF +137.9px).typeset.rsprocess_multicolumn_break: 새 다단 zone 시작 여유가 헤더 띠 1개 높이(~56px) 미만이면push_new_page. ② Distribute 다단 vpos-reset 검출: 직전 문단vpos+line_height기준 비교로 1줄짜리 컬럼(prev vpos=0, curr vpos=0)도 컬럼 전환 인식. → shortcut.hwpLAYOUT_OVERFLOW25→2.검증
cargo test --release전건 통과(34 test suites). svg_snapshot 8/8 — golden 2건(issue-267/ktx-toc-page,issue-617/exam-kor-page5) 갱신: 섹션-시작 문단이LINE_SEG.vertical_pos기준으로 재배치, 한컴이 파일에 기록한 위치와 정합.pdf/basic/shortcut-2022.pdf픽셀 측정(mutool draw -r 100): 1쪽 제목·헤더 띠·본문 첫 줄, 2쪽 헤더 띠 상/하단 모두 한컴 PDF 와 ±1px 수렴.잔존 (신규 후속 이슈)
간격=0mm이라 미설명; 닫힌 PR Task #770: shortcut 페이지 2~7 헤더 TAC 표 후속 LINE_SEG 정합 #771/Issue shortcut.hwp 페이지 2~7 헤더 TAC 1x1 표 후속 spacing 누락 (~13-33px 압축) #770/RFC [RFC] 한컴 PDF paragraph spacing 알고리즘 정밀 분석 (heading + TAC 표 + zone-level) #774 도 미해결).LAYOUT_OVERFLOW2건 (shortcut.hwp: 쪽나누기로 시작하는 페이지의 헤더 TAC 띠 ↔ 본문 사이 ~28px gap 미재현 #866 에 종속).문서
mydocs/tech/hancom_zone_paragraph_spacing.mdmydocs/report/task_m100_853_report.mdmydocs/plans/,mydocs/working/🤖 Generated with Claude Code